const baseUrl = `https://1286116457290391.cn-beijing.fc.aliyuncs.com/2016-08-15/proxy/moadmin.LATEST/mp_app/api/info?mpname=`;

module.exports = {
    request: (queryData) => {
        return new Promise((resolve, reject) => {
            wx.request({
                url: `${baseUrl}${queryData}`,
                method: 'GET',
                header: {
                    'content-type': 'application/json'
                },
                success: (res) => {
                    if (res.data.code == 'SUCCESS' || res.data.code == 'OK') {
                        resolve(res.data.data);
                    } else {
                        reject(`数据请求失败${res.data.msg || '未知错误'}`);
                    }
                },
                fail: (err) => {
                    reject(err);
                }
            });
        });
    }
};
